#pragma once

inline int NextPowerOf2( int pA )
{
	int rval = 1;

	while( rval < pA ) 
	{
		rval <<= 1;
	}

	return rval;
}

void MakeDisplayList( FT_Face pFace, char pCh, GLuint pListBase, GLuint * pTexBase );

class FontManager
{
private:
	class Font
	{
	public:
		float height;

		GLuint *textures;
		GLuint base;

		bool error;

		Font( const char *pFilename, unsigned int pHeight );
		~Font( void );
	};

	Font **mFonts;

	int mnFonts;
	int mnCurrentFonts;
public:
	FontManager( const int pFonts );
	~FontManager( void );

	int LoadFont( const char *pFilename, const int pSize );

	void Print( const int prId, const float pX, const float pY, const char *pFmt, bool pMultiline = false, ... );
};

